HTMLModelElement: boundingBoxCenter property
Once a model resource has is ready and renderable, the HTMLModelElement.boundingBoxCenter
property indicates the center of the axis-aligned bounding box (AABB) of a model resource's contents, irrespective of their size.
Note:
The values for the bounding box information remains constant for the lifetime of the model. If a model contains animated content, the values of boundingBoxCenter
and boundingBoxExtents
will reflect the state of the model on the first frame of the animation, or the bounding box of the skeletal bind pose, if a skeletal animation is present.
Value
A DOMPointReadOnly
that reflects the center in X, Y, and Z of the model resource. For example, both a 1m cube centered on the origin and one centered at (100,0,0) will have a boundingBoxExtents
value of (1,1,1), but the offset cube's boundingBoxCenter
will be (100,0,0) and the origin-centered one will be (0,0,0).
Note: While there are many useful computations of an object's center or size, such as center of mass or mean vertex position, the bounding box center and extents exclusively refer to the bounding box between the minimum and maximum position of the model's vertices in X, Y, and Z.
Specifications
No specification found
No specification data found for api.HTMLModelElement.boundingBoxCenter
.
Check for problems with this page or contribute a missing spec_url
to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.
Browser compatibility
See also
HTMLModelElement
: Interface used to define theHTMLModelElement.boundingBoxCenter
property